<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>类的基本知识</title>
</head>
<body>
    <script type="text/javascript">
        class Car{
            constructor(name,price){
                this.name = name;
                this.color = price;
            }
            //类中可以直接写赋值语句，添加类中的属性，注意不要前面加let
            wheel = 4;
        }

        const car1 = new Car('奔驰',200);
        console.log(car1);
    </script>
</body>
</html>